Remove insert data of a specific table from MySQL dump output.
Remove insert data of a specific table from MySQL dump output.
26927-Jul-2023
Updated on 28-Jul-2023
Home / DeveloperSection / Forums / Remove insert data of a specific table from MySQL dump output.
Remove insert data of a specific table from MySQL dump output.
Aryan Kumar
28-Jul-2023Sure, you can remove insert data of a specific table from MySQL dump output using the
-d
option with themysqldump
command. The-d
option will suppress the output of theINSERT
statements for the specified table.To remove insert data of a specific table from MySQL dump output, you can follow these steps:
For example, the following command will remove insert data of the
products
table from themydb
database and save the output to thedump_file.sql
file:This will create a new file called
dump_file.sql
that contains the schema for theproducts
table, but it will not contain any data.Here are some additional things to keep in mind when using the
-d
option:-d
option is case-insensitive.-d
option to suppress the output of theINSERT
statements for multiple tables by specifying the table names as comma-separated values.-d
option with other options to further customize the output of themysqldump
command.